%{
	#include <stdlib.h>
	#include "symbols.h"
	#include "lex-tools.h"
%}
%option noyywrap
%option yylineno
%option header-file="lexer.h"

spacing			[\n\r\t ]
delimiter		{spacing}+
comment			#[^\n]+
digit			[0-9]
sign			\+
sugar			[:;\(\),]
intconst		{sign}?{digit}+
floatconst		({sign}?{digit}+\.{digit}+|0)
numberconst		{intconst}|{floatconst}
filename		[a-zA-Z\.\_0-9]+
stringconst		\"[^\n\"]*\"
boolconst		(true|false)


%%

{delimiter}						;
{comment}						;
<<EOF>>							{return ENDOFFILE;}
NUMBER                          {return _NUMBER;}
OF                              {return _OF;}
VERTICES                        {return _VERTICES;}
EDGES                           {return _EDGES;}
CAPACITY                        {return _CAPACITY;}
TIME                            {return _TIME;}
LIMIT                           {return _LIMIT;}
LIST                            {return _LIST;}
DEPOT                           {return _DEPOT;}
cost                            {return _COST;}
demand                          {return _DEMAND;}
profit                          {return _PROFIT;}
{sugar}							{return yytext[0];}
{intconst}						{lexval.ival=atoi(yytext); return _INTEGERCONST;}
{floatconst}					{lexval.fval=atof(yytext); return _FLOATCONST;}
{boolconst}						{lexval.ival=yytext[0]=='t'?1:0; return _BOOLEANCONST;}
{filename}						{lexval.sval=createString(yytext); return _FILENAMECONST;}
{stringconst}					{lexval.sval=createString(yytext); return _STRINGCONST;}
.								{fprintf(stderr,"error Revealed %d!\n\"%s\"",yylineno,yytext);return ERROR;}


%%